import { getServerTime } from "../serverTime"

/** 服务器时间拦截器 */
export default function serverTimeInterceptor({request}) {
  request.use((config) => {
    return getServerTime().then((t) => {
      config.serverTime = t;
      return config;
    });

  }, (error) => {
    return Promise.reject(error)
  })
}